Better Stealth AI for Followers

-DAWNGUARD VERSION-

Version: 3.1
Author: kryptopyr
Released: 01-05-2013


Description
-----------------------------------------------------
This mod improves the stealth AI for followers, so they don't rush into combat before the enemy has fully detected the player. Followers will also unequip torches while sneaking.

This will work with any follower who uses the default follower system, including followers added by other mods and even animals (if they use the default follower quest). Please read "How it Works" below for additional changes. 


WHAT IT DOES:
This mod changes follower behavior in two ways. These changes only occur while the player is sneaking. If the player is not sneaking, then the follower's behavior will be unchanged.

1) While the player is sneaking, the follower won't initiate combat with nearby hostiles until after the enemy has actually attacked. Once either the follower or the player is attacked, the follower will enter combat like normal.

2) If the follower has a torch equipped, they will unequip the torch while sneaking.

Note: If you give your follower a torch while they are already in sneak mode, they may choose to equip it. If you don't want them to use the torch, simply exit sneak mode, wait a few seconds, then re-enter sneak mode. This will trigger them to unequip the new torch.


COMPATIBILITY
-----------------------------------------------------
This mod is fully compatible with other mods that alter the NPCs, such as Better Followers and Specialized Followers, and with mods that change NPC appearance. It is also compatible with mods that alter the follower quest/dialogue such as UFO, EFF, or AFT.


HOW IT WORKS
-----------------------------------------------------
After installing the mod, a new dialogue option ("Let's discuss stealth combat tactics...") will appear when you talk to your follower. Selecting this dialogue will assign your follower to one of the Better Stealth aliases. After this, you will have two options...normal combat behavior or the modified stealth combat behavior. You can choose to switch back and forth between these modes any time you talk to your follower. Followers who have been assigned to Better Stealth aliases will always unequip torches while sneaking no matter which combat mode they are in.

IMPORTANT THINGS TO NOTE:
1) You must select the initial dialogue topic before your follower will exhibit the new stealth behavior.
2) If you dismiss your follower or have them wait, they will retain the chosen behavior the next time you ask them to follow (unless you clear the aliases).
3) You can have up to 25 followers assigned to Better Stealth aliases. If you exceed this number, a message box will come up asking you if you want to clear the aliases. Selecting "Yes" will clear all aliases. This means you will have to speak with any followers to reassign them.
4) For some reason, followers don't always put away their torch the first time you sneak after hiring them. This issue can be corrected by dismissing/rehiring them. It also seems to naturally correct itself after the first combat engagement.
5) Cicero and the Dark Brotherhood Initiates are already assigned permanent aliases, which don't count toward the twenty-five follower limit.

In addition to standard followers, a few quest followers have been given this modified behavior.  The new stealth behavior has been added to Mercer Frey (during the quest Speaking with Silence) and Brynjolf & Karliah (during the quest Blindsighted).  These quest followers will automatically exhibit the stealth combat behavior and do not have the dialogue option to toggle the behavior on/off.



CREDITS
-----------------------------------------------------
fg109 for helping me with the initial script.
DreamKing, JustinOther, and nbtc971 for the unequip torch script.
technowizard79 for script improvements.



CHANGE LOG
-----------------------------------------------------
V3.1
Dawnguard compatible version - adds Better Stealth AI options to Serana

v3.0
Combined Standard & Unique versions into a single mod
Made a few small adjustments to the package conditions that will hopefully correct some minor issues

V2.1
Improvements made to script (courtesy of technowizard79). It now takes into account fortify health effects.
Stealth behavior will now apply to all standard followers.
Added dialogue option to toggle stealth behavior for individual followers.

V 2.0
Completely remade Standard version to increase its compatibility with other mods.
Added 11 more followers.
Added Housecarls (torch only).

V 1.0
Followers now unequip torches when sneaking.
Removed the addition of Brynolf & Vex as followers after Thieves Guild quest. This feature is still available as a separate mod, here.
Applied the stealth AI behavior to a handful of standard followers in a separate .esp file.